<script setup>
import {ref} from "vue";
const activeNames = ref(['0']);
import {storeToRefs} from 'pinia'
import {useResultPub} from '../../../stores/result-public.js'
const pubStore = useResultPub();
const {noticeList,newsList,yanboList} = storeToRefs(pubStore)
</script>

<template>
  <van-collapse v-model="activeNames" :accordion="false">
    <van-collapse-item title="公告风险" name="1" :value="`${noticeList.length}条相关公告`">
      <div class="stepContainer">
        <van-steps direction="vertical" active="none" inactive-color="#ccc">
          <van-step v-for="item in noticeList">
            <h3>{{item.date}} {{item.title}}</h3>
            <div class="tags">
              <van-space size="6px">
                <van-tag v-for="tag in item.tags" type="danger">{{tag}}</van-tag>
<!--                <van-tag type="danger">平仓风险</van-tag>-->
              </van-space>
            </div>
          </van-step>
        </van-steps>
        <div class="check-more">
          <span>查看历史</span> <van-icon name="arrow" />
        </div>
      </div>
    </van-collapse-item>
    <van-collapse-item title="新闻风险" name="2" :value="`${newsList.length}条相关新闻`">
      <div class="stepContainer">
        <van-steps direction="vertical" active="none" inactive-color="#ccc">
          <van-step v-for="item in newsList">
            <h3>{{item.title}}</h3>
            <div class="tags">
              <van-space size="6px">
                <van-tag v-for="tag in item.tags" type="danger">{{tag}}</van-tag>
              </van-space>
            </div>
          </van-step>
        </van-steps>
        <div class="check-more">
          <span>查看历史</span> <van-icon name="arrow" />
        </div>
      </div>
    </van-collapse-item>
    <van-collapse-item title="研报风险" name="3" :value="`${yanboList.length}条相关研报`">
      <div class="stepContainer">
        <van-steps direction="vertical" active="none" inactive-color="#ccc">
          <van-step v-for="item in yanboList">
            <h3>{{item.title}}</h3>
            <div class="tags">
              <van-space size="6px">
                <van-tag v-for="tag in item.tags" type="danger">{{tag}}</van-tag>
              </van-space>
            </div>
          </van-step>
        </van-steps>
        <div class="check-more">
          <span>查看历史</span> <van-icon name="arrow" />
        </div>
      </div>
    </van-collapse-item>
  </van-collapse>
</template>

<style scoped lang="scss">

</style>